home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-0497 / AMOSLIST / text0018.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  1.7 KB  |  57 lines

  1. To the one known as Jamie,
  2.  
  3. > Okay, I'm not going to brag on about anything... All I want to know
  4. > is how to use normaly inputs and take "BITS" from it, and make it
  5. > NON case sensative...
  6. >   So if I took say this:
  7. >  Eat the cow
  8. >  And the cow didn't exist, it should say:
  9. >  There is no cow to eat.
  10. >  I don't know ho to do that normally...
  11. >  Also: Case sensetive etc:
  12. >  I want this:
  13. >      HELLO
  14. >  To be the same as this:
  15. >      HeLlO
  16.  
  17. Case sensitive is the easy bit, use Upper$ to convert it to upper case for
  18. manageability, then split them into different words.  Now things get really
  19. difficult.  EAT & COW is fairly straight forward, but you need to take into
  20. account all your objects that are edible, and all the command words you are
  21. using, related to other command words and objects, so each thing relates to
  22. another thing, so to EAT your COW, you would probably need a FORK or a
  23. DEAD-COW.  
  24.  
  25. There are two main ways of working out EAT the COW, one is extensive
  26. programming on a per-location basis, and the other is with huge databases,
  27. but to start you off, here is some code to split up your input.
  28.  
  29. dim split$(10):rem 10 words max.
  30. line input a$ :rem nasty input.
  31. a$=upper$(a$)
  32. c=1
  33. for n=1 to len(a$)
  34.     z$=mid$(a$,n,1)
  35.     if z$=" "
  36.         c=c+1
  37.     else
  38.         split$(c)=split$(c)+z$
  39.     end if
  40. next
  41.  
  42. (end of code)
  43.  
  44. split$(1)="EAT"
  45. split$(2)="THE"
  46. split$(3)="COW"
  47.  
  48. ..let me know if you  need more help/code.
  49.  
  50.  _   _   _        _     _   _     |  
  51. |_> |_| |_| |\ | |_ |  | | /   |  |  "Would you like a Jellybaby ?"
  52. |_> | \ | | | \| |_ |_ |_| \_  .  |        - The Doctor
  53.                                   |
  54.                     --------------+---------------
  55.                      http://www.mirex.demon.co.uk
  56.  
  57.